import request from '@/utils/request';

export function exportSum() {
  return request({
    url: "/dormitory/dms-dormitory-dept/exportSum",
    method: "get"
  });
}


export function cancelDept(data) {
  return request({
    url: "/dormitory/dms-dormitory-dept/cancelDept",
    method: "post",
    data
  });
}

export function lockDept(data) {
  return request({
    url: "/dormitory/dms-dormitory-dept/lockDept",
    method: "post",
    data
  });
}

export function lockAllDept(){
  return request({
    url: "/dormitory/dms-dormitory-dept/lockAllDept",
    method: "post"
  });
}

export function getDeptDetail(code) {
  return request({
    url: "/dormitory/dms-dormitory-dept/getDeptDetail/" + code,
    method: "GET"
  });
}


export function getDeptBedCount() {
  return request({
    url: "/dormitory/dms-dormitory-dept/getDeptBedCount",
    method: "GET"
  });
}


export function doFast(data) {
  return request({
    url: "/dormitory/dms-dormitory-dept/doFast",
    method: "post",
    data
  });
}


export function changeDeptBed(data) {
  return request({
    url: "/dormitory/dms-dormitory-dept/changeDeptBed",
    method: "POST",
    data
  });
}


// 分配学院宿舍
export function assCollegeDormitory(data) {
  return request({
    url: "/dormitory/dms-dormitory-dept/allocation",
    method: "POST",
    data
  })
}


// 查看宿舍楼
export function listBuilding(params) {
  return request({
    url: "/dormitory/dms-dormitory-dept/getBuilding",
    method: "GET",
    params
  })
}

// 查看学院
export function getCollege(params) {
  return request({
    url: "/dormitory/dms-dormitory-dept/getDept",
    method: "GET",
    params
  })
}

// 查看宿舍
export function listDormitory(params) {
  return request({
    url: "/dormitory/dms-dormitory-dept/getDormitory",
    method: "GET",
    params
  })
}

// 根据宿舍楼id查看楼层
export function listFloor(params) {
  return request({
    url: "/dormitory/dms-dormitory-dept/getFloor",
    method: "GET",
    params
  })
}

// 取消绑定某宿舍
export function unbindDor(data) {
  return request({
    url: `/dormitory/dms-dormitory-dept/unbind/${data.dormitoryIds}/${data.academyCode}`,
    method: "post",
    data
  })
}

export function listCampus() {
  return request({
    url: "/dormitory/dms-dormitory-dept/getCampus",
    method: "GET"
  })
}

export function listPark(params) {
  return request({
    url: "/dormitory/dms-dormitory-dept/getPark",
    method: "GET",
    params
  })
}